from pydantic import BaseModel, Field
from typing import Optional


class ReqPackage(BaseModel):
    id: Optional[int] = None
    name: str = Field(example="python", min_length=1)
    description: str = Field(example="123", min_length=2)
    env_append: dict = Field(example="{key: value}")
    package_type: str = Field(example="pip", min_length=1)
    package_url: str = Field(example="", default="")
    cache_name: str = Field(example="python{suffix}", min_length=1)


class DelectePackage(BaseModel):
    id: int = Field(example=1)

